
#ifndef SCANNER_H
#define SCANNER_H

#include <istream>
#include <regex>
#include "Token.h"

namespace mjc {

	class Scanner
	{
	private:
		wchar_t ch;//current character
		int column;
		int line;
		int position;
		std::wstring lexeme;
		std::wistream in;

		static const wchar_t eol;
		static const wchar_t eof;

		static const std::tr1::wregex sRegex;
		static const std::tr1::wregex nRegex;
		static const std::tr1::wregex snRegex;

		void NextChar();
		void ReadName(Token& token);
		void ReadNumber(Token& token);

	public:
		Scanner(std::wstreambuf* inbuf);
		Scanner(Scanner& other);
		
		Token NextToken();
	};
}

#endif